from my_selenium import webdriver
import time,os

if __name__ == "__main__":
 browser = webdriver.Firefox(executable_path=r"C:\Program Files\Python\Python38\Scripts\geckodriver.exe")
 browser.get("http://47.96.127.211:8502/login")
 user_name = browser.find_element_by_id('userName')
 user_name.clear()
 user_name.send_keys("186747829")
 password = browser.find_element_by_id('password')
 password.clear()
 password.send_keys("123456")
 browser.find_element_by_class_name('submit-btn').submit()
 time.sleep(1)
 a = browser.find_element_by_link_text('诉讼立案对账')
 browser.find_elements
 a_url = a.get_attribute('data-url')
 # browser.find_element_by_id('upload')
 # p = browser.find_element_by_class_name('layui-btn layui-btn-primary')
 print(a)
 table= browser.find_elements_by_tag_name('table')
 print (browser.current_url)
 aaa =browser.get_cookies()
 print(aaa)#[{'name': 'JSESSIONID', 'value': 'D3C385A749E13F75216632FF6C3A8825', 'path': '/', 'domain': '47.96.127.211', 'secure': False, 'httpOnly': True}]
 browser.get('http://47.96.127.211:8502'+a_url)
 browser.find_element_by_id('upload').click()
 # browser.find_element_by_tag_name('71').click()
 # browser.find_element_by_id('upload').send_keys(r'D:\jin\downloads\财务所属平台案件信息 (1).xls')
 #  browser.find_elements_by_link_text('诉讼立案对账 ').click()
 # driver.find_element_by_id("coverImgSrc").send_keys(u"%s"%tds["coverImgSrc"])
#  driver.find_element_by_id("user_name").clear()
# driver.find_element_by_id("user_name").send_keys("username")
# driver.find_element_by_id("user_pwd").clear()
# driver.find_element_by_id("user_pwd").send_keys("password")
# driver.find_element_by_id("dl_an_submit").click()
# #通过submit() 来提交操作
# #driver.find_element_by_id("dl_an_submit").submit()
